# delimit;


* This file creates gt1 variables needed from num variables;
* It needs the num variables;

* Our naming convention is: measure_account_delinquency;

* the loop structure would look as such, but we will do it by brute force;
* Loop ;
* measure = num gt1 bal (note next 4 vars do not have delinquency = tot)  gt1c balc frbal frnum;
*   account = all autof autob bankc consf fmrtg helin helre retal other auto bcret home home2 exhome exhome2 exauto other2;
*      delinquency = tot 30 60 90 120 der;



* GT1 variables;
foreach acct in all autof autob bankc consf fmrtg helin helre retal other auto bcret home exhome other2 {;
  foreach del in tot 90 {;
    gen gt1_`acct'_`del' = (num_`acct'_`del' >= 1);
    replace gt1_`acct'_`del' = . if num_`acct'_`del' == .;
  };
};

compress;
desc;

